class Disciplina < ActiveRecord::Base

  set_table_name "disciplina"

  belongs_to :organ , :foreign_key => "orgao"
  belongs_to :level , :foreign_key => "nivel"
  belongs_to :disciplinatype , :foreign_key => "tipodisciplina"

  has_many :historico

  validates_presence_of :id
  validates_presence_of :organ
  validates_presence_of :nivel
  validates_presence_of :nome
  validates_presence_of :nomecompleto
  validates_presence_of :ativa
  validates_presence_of :numaprovacao
  validates_presence_of :credteorico
  validates_presence_of :credpratico
  validates_presence_of :credestagio
  validates_presence_of :tipodisciplina
  validates_uniqueness_of :id
  validates_numericality_of :id

end
